﻿using System.ComponentModel;
using System.Linq;
using System.Reflection;

namespace Glorysoft.EAP.Core.Enums
{
    public enum MaterialTypeEnum
    {
        /// <summary>
        /// 划片胶膜
        /// </summary>
        [Description("AdhesiveFilm")]
        AdhesiveFilm,
        /// <summary>
        /// 劈刀
        /// </summary>
        [Description("Capillary")]
        Cleaver,
        /// <summary>
        /// 划片刀Z1
        /// </summary>
        [Description("DicingKnifeZ1")]
        DicingKnifeZ1,
        /// <summary>
        /// 划片刀Z2
        /// </summary>
        [Description("DicingKnifeZ2")]
        DicingKnifeZ2,
        /// <summary>
        /// 粘片胶
        /// </summary>
        [Description("Epoxy")]
        Epoxy,
        /// <summary>
        /// 粘片胶2
        /// </summary>
        [Description("Epoxy2")]
        Epoxy2,
        /// <summary>
        /// 夹具
        /// </summary>
        [Description("Jig")]
        Fixture,
        /// <summary>
        /// 研磨轮1
        /// </summary>
        [Description("GrindingWheel1")]
        GrindingWheel1,
        /// <summary>
        /// 研磨轮2
        /// </summary>
        [Description("GrindingWheel2")]
        GrindingWheel2,
        /// <summary>
        /// 注射头、料筒
        /// </summary>
        [Description("InjectionHeadAndBarrel")]
        InjectionHeadAndBarrel,
        /// <summary>
        /// 镶件
        /// </summary>
        [Description("Insert")]
        Insert,
        /// <summary>
        /// 框架
        /// </summary>
        [Description("LF")]
        LF,
        /// <summary>
        /// 塑封料
        /// </summary>
        [Description("MoldingCompound")]
        MoldingCompound,
        /// <summary>
        /// 凸模
        /// </summary>
        [Description("Punch")]
        Punch,
        /// <summary>
        /// 吸嘴
        /// </summary>
        [Description("Collect")]
        SuctionNozzle,
        /// <summary>
        /// 顶针
        /// </summary>
        [Description("Ejector")]
        Thimble,
        /// <summary>
        /// 减薄胶膜
        /// </summary>
        [Description("ThinnerAdhesiveFilm")]
        ThinnerAdhesiveFilm,
        /// <summary>
        /// 焊丝
        /// </summary>
        [Description("Wire")]
        WeldingWire,
        /// <summary>
        /// 贴膜刀片
        /// </summary>
        [Description("CutBlade")]
        CutBlade,
        /// <summary>
        /// 物料盒
        /// </summary>
        [Description("WaferCassette")]
        WaferCassette,
        /// <summary>
        /// 抛光液
        /// </summary>
        [Description("Polishinglequid")]
        Polishinglequid,
        /// <summary>
        /// 揭膜胶带
        /// </summary>
        [Description("PeelingTape")]
        PeelingTape,
        /// <summary>
        /// 清洗液
        /// </summary>
        [Description("Cleaner")]
        Cleaner,
        /// <summary>
        /// 晶圆
        /// </summary>
        [Description("Wafer")]
        Wafer,
        /// <summary>
        /// 顶针帽
        /// </summary>
        [Description("EjectorCap")]
        PinCap,
        /// <summary>
        /// 上芯夹具
        /// </summary>
        [Description("JigDB")]
        JigDB,
        /// <summary>
        /// 点胶头
        /// </summary>
        [Description("Nozzle")]
        Nozzle,
        /// <summary>
        /// 点胶头
        /// </summary>
        [Description("Nozzle2")]
        Nozzle2,
        /// <summary>
        /// 螺丝
        /// </summary>
        [Description("Screw")]
        Screw
    }

    public static class MaterialTypeExtension
    {
        public static string GetName(this MaterialTypeEnum type)
        {
            FieldInfo info = type.GetType().GetField(type.ToString());
            var attr = info.GetCustomAttributes<DescriptionAttribute>().FirstOrDefault();
            return attr?.Description;
        }
    }
   
   
}
